package com.freemypay.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.freemypay.entity.User;
import com.freemypay.service.UserService;

/**
 * User接口
 * @author yesixian
 *
 */
@Controller
@RequestMapping("/user")
public class UserController {

	@Autowired
	private UserService userService;
	
	/**
	 * 根据用户id查询用户信息
	 * @param id
	 * @return com.freemypay.entity.User
	 */
	@RequestMapping("/selectUser/{id}")
	@ResponseBody
	public User selectByPrimaryKey(@PathVariable Long id) {
		User user = userService.selectByPrimaryKey(id);
		return user;
	}
	
	@RequestMapping("/transactionTest")
	public void transactionTest(Long id) {
		userService.transactionTest(id);
	}
	
}
